#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>

#include "bitfetchtable/bittablemanager.h"

int main()
{
    BitTableManager *bittableManager = BitTableManager::instance();

    //BitHashTableHandle *handle = bittableManager->createDiskTableHandle("./", "table");
    BitHashTableHandle *handle = bittableManager->createMemTableHandle("table");

    HashableString str1("hello");
    HashableString str2("hella");
    handle->setBit(str1);

    /*
    for (int i = 0; i < 10000000; i ++) {
        HashableString str("hello world, hello world"); 
        handle->testBit(str1);
    }*/

    printf("str1 bit value : %d\n", handle->testBit(str1));
    printf("str2 bit value : %d\n", handle->testBit(str2));

    bittableManager->destoryTableHandle("table");

    return 0;
}
